//package cn.microservices.shpplychain.gateway.filter;
//
//import org.springframework.context.annotation.Bean;
//import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
//import org.springframework.security.config.web.server.ServerHttpSecurity;
//import org.springframework.security.core.userdetails.ReactiveUserDetailsService;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.web.server.SecurityWebFilterChain;
//import reactor.core.publisher.Mono;
//
//@EnableWebFluxSecurity
//public class AuthorizedFilter {
//
//
//    @Bean
//    public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
//        http.csrf().disable().
//                formLogin().disable().
//                httpBasic().and().
//                logout().disable()
//                .
////                addFilterBefore(globalWebFilter, SecurityWebFiltersOrder.AUTHENTICATION).
//                authorizeExchange().
//                pathMatchers("add", "del").authenticated().
//                anyExchange().permitAll().and()
//                ;
//
//
//        return http.build();
//    }
//
//    @Bean
//    public ReactiveUserDetailsService userDetailsService() {
//
//        return username -> Mono.just(User.withUsername("admin")
//                .password("{noop}" + "admin")
//                .authorities("add", "del")
//                .build());
//
//    }
//
//
//}
